<template>
<div class="layerRtb layerRtb-threecolumn">
    <three-title :title="{name:'人员'}"></three-title>
    <div class="layerRtb-scroll thinScroll" v-scrollHeight = "137">
        <div class="analyItem" v-for="(item,index) in peopleAll.allOnJob" :key="index">
            <p class="analyItemTit tx-center">人员{{index + 1}}</p>
            <div class="analyItemCon">
                <p class="col-md-4">
                    <span class="cLightGray pr8">姓名</span>
                    <span>{{item.u_xingming}}</span>
                </p>
                <p class="col-md-4">
                    <span class="cLightGray pr8">接单</span>
                    <span>{{item.orderNum}}</span>
                </p>
                <p class="col-md-4">
                    <span class="cLightGray pr8">级别</span>
                    <span>{{item.abilityLevel}}</span>
                </p>
                <p class="col-md-4">
                    <span class="cLightGray pr8">产值</span>
                    <span>{{item.completionMoney == 0 ? 0 : (item.completionMoney / 10000).toFixed(2)}}W</span>
                </p>
                <p class="col-md-4">
                    <span class="cLightGray pr8">差额</span>
                    <span>{{item.difference == 0 ? 0 : (item.difference / 10000).toFixed(2)}}W</span>
                </p>
            </div>
        </div>
    </div>
    <div class="layerRtb-footer">
        <div class="analyItem">
            <p class="analyItemTit tx-center">综合</p>
            <div class="analyItemCon">
                <p class="col-md-3">
                    <span class="cLightGray pr8">人数</span>
                    <span>{{peopleAll.personNumber}}</span>
                </p>
                <p class="col-md-3">
                    <span class="cLightGray pr8">接单</span>
                    <span>{{peopleAll.sumOrderNum}}</span>
                </p>
                <p class="col-md-3">
                    <span class="cLightGray pr8">人均产值</span>
                    <span>{{peopleAll.avgCompletionMoney}}</span>
                </p>
                <p class="col-md-3">
                    <span class="cLightGray pr8">产出比</span>
                    <span>{{peopleAll.sumCompletionMoney == 0 ?  0 :(peopleAll.sumCompletionMoney / (peopleAll.sumGreatMore * 10000) * 100).toFixed(2)}}%</span>
                </p>
            </div>
        </div>
    </div>
</div>
</template>
<script>
import {getDivisionPersonnel} from '../../Resources/Api'
export default {
    data () {
        return {
            peopleAll: {}
        }
    },
    created () {
        this.getDivisionPersonnel()
    },
    methods: {
        getDivisionPersonnel () {
            var obj = {
                diqu: this.$route.query.regionId
            }
            getDivisionPersonnel(obj).then(res => {
                if (res.data.StatusCode === 0) {
                    this.peopleAll = res.data.Body
                }
            }).catch(err => {
                console.log(err)
            })
        }

    }
}
</script>
